<?php
/**
 * 公共頁
 * @author user zhukoo
 *
 */
class Common extends Service {
	
	/**
	 * 默認method
	 * @param array $param
	 */
	public function run($param = ''){}
	
	/**
	 * 驗證碼
	 */
	public function verify(){
		ZKF::import("Image");
		Image::buildImageVerify(4, 1, 'png', 48, 22, 'verify');
	}
	
	/**
	 * ajax檢查驗證碼
	 * @param string $verify
	 * @return array
	 */
	public function check_verify($verify) {
		if(strtolower(md5($verify)) == ZKF::session('verify')){
			return array('info'=>'驗證碼正確！','status'=>'y');
		}else{
			return array('info'=>'驗證碼錯誤！','status'=>'n');
		}
	}
}
?>